package com.hhkj.generator.util;

import java.io.File;

/**
 * 路径工具类
 * 
 * @author
 * 
 */
public class PathUtil {

	/*
	 * 获取classpath1
	 */
	public static String getClasspath(){
		String path = (String.valueOf(Thread.currentThread().getContextClassLoader().getResource(""))+"../../").replace("file:/", "").replace("%20", " ").trim();	
		if(path.indexOf(":") != 1){
			path = File.separator + path;
		}
		return path;
	}
	
	/*
	 * 获取classpath2
	 */
	public static String getClassResources(){
		String path =  (String.valueOf(Thread.currentThread().getContextClassLoader().getResource(""))).replace("file:/", "").replace("%20", " ").trim();	
		if(path.indexOf(":") != 1){
			path = File.separator + path;
		}
		return path;
	}

	public static void main(String[] args) {
		System.out.println(getClasspath());
	}

}
